<?php
//
defined('BY_JYA') or exit('error');
cfc('core')->checklogin();
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
$setting=$this->plugin_setting('setting');
$return['setting'] = $setting;
$return['footernav']=$setting['footernav'];
if($_RQ['op']=='main'){
	//$post=get_postdata();
	$params=array('uniacid'=>$_SESSION['uniacid'],'uid'=>$_SESSION['uid']);
	$pindex = max(1, intval($post['page']));
	$psize = 15;
	$total='';
	if($_RQ['status']){
		$params['status']=$_RQ['status'];
	}
	$return['list']=pdo_getslice('jy_cmshouse_list',$params,array($pindex,$psize),$total,$fields,'','createtime desc');
	foreach($return['list'] as &$v){
		$v['createtime']=date('Y-m-d H:m:s',$v['createtime']);
		if($v['type']==1){
			$v['type']='新房';
		}elseif($v['type']==2){
			$v['type']='二手房';
		}
	}
	set_html('title','我的');
	exi($return);
}

if($_RQ['op']=='del'){
	if(!$_RQ['id']){
		exi('请先选择项目','error');
	}
	$order=pdo_get('jy_cmshouse_list',array('id'=>$_RQ['id']));
	pdo_delete('jy_cmshouse_list',array('id'=>$_RQ['id']));
	exi('删除成功');
}
?>